const Api = require('api.js');
const Rest = require('rest.js');
function navigateBack() {
    wx.navigateBack({
        delta: 1,
        fail: function (res) {
            wx.switchTab({
              url: '/pages/index/index',
            })
        }
    });
}

function getshare(that){
    Rest.get(Api.JIANGQIE_SETTING_SHARE).then(res => {
        console.log(res.data)
        that.setData({
            shares: res.data,
            shares: res.data
        })
    })
}
    //是否包含指定字符
    function IsHaveStr(str, target){
        if(str.indexOf(target)!==-1){
            return true;
        }
        return false;

    }
    function IsNotEmpty ( value) {
        if (value!=="" &&value!==undefined && value!==null &&value.length!==0 && value !== false &&value!== [] &&value!== {}){
            return true;
        } else return false;

    }
module.exports = {
    navigateBack,
    getshare,
    IsHaveStr,
    IsNotEmpty,
}